package com.breakfast.fun.data.entity.mall;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by yukai on 16/10/5.
 */

public class MallOrderDetail {

    /**
     * total : 0
     * pageTotal : 0
     * data : {"id":2115,"orderTime":"2016-10-05 16:40:17","orderNo":"GF201610051640175407","totalPrice":10,"payPrice":10,"freePrice":0,"payFree":0,"quantity":1,"refundState":0,"state":0,"consignee":"zzhyzy","userMobile":"18359928629","detail":"0","remark":"","activityName":"","goods":[{"id":2351,"orderId":2115,"orderNo":"GF201610051640175407","productId":91,"productPrice":10,"productCount":1,"productName":"冰箱收纳盒整理箱日式水饺盒厨房塑料密封保鲜食物鸡蛋储物箱水果1个","free":0,"categoryId":0,"productImage":"http://m.52letsgo.cn/product_image/4/13/c2627d62-5_485199752.jpg","totalPrice":10}]}
     * msg : 查询成功
     * success : true
     */

    private int total;
    private int pageTotal;
    /**
     * id : 2115
     * orderTime : 2016-10-05 16:40:17
     * orderNo : GF201610051640175407
     * totalPrice : 10.0
     * payPrice : 10.0
     * freePrice : 0.0
     * payFree : 0.0
     * quantity : 1
     * refundState : 0
     * state : 0
     * consignee : zzhyzy
     * userMobile : 18359928629
     * detail : 0
     * remark :
     * activityName :
     * goods : [{"id":2351,"orderId":2115,"orderNo":"GF201610051640175407","productId":91,"productPrice":10,"productCount":1,"productName":"冰箱收纳盒整理箱日式水饺盒厨房塑料密封保鲜食物鸡蛋储物箱水果1个","free":0,"categoryId":0,"productImage":"http://m.52letsgo.cn/product_image/4/13/c2627d62-5_485199752.jpg","totalPrice":10}]
     */

    private MallOrderDetailData data;
    private String msg;
    private boolean success;

    public static MallOrderDetail objectFromData(String str) {

        return new Gson().fromJson(str, MallOrderDetail.class);
    }

    public static List<MallOrderDetail> arrayMallDetailDataFromData(String str) {

        Type listType = new TypeToken<ArrayList<MallOrderDetail>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public MallOrderDetailData getData() {
        return data;
    }

    public void setData(MallOrderDetailData data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }
    /**
     * id : 2351
     * orderId : 2115
     * orderNo : GF201610051640175407
     * productId : 91
     * productPrice : 10.0
     * productCount : 1
     * productName : 冰箱收纳盒整理箱日式水饺盒厨房塑料密封保鲜食物鸡蛋储物箱水果1个
     * free : 0.0
     * categoryId : 0
     * productImage : http://m.52letsgo.cn/product_image/4/13/c2627d62-5_485199752.jpg
     * totalPrice : 10.0
     */


}
